import React from "react";
import screening_room from "@/assets/img/screening_room.jpg";
import configure from "@/assets/img/configure.jpeg";
import { withRouter, RouteComponentProps } from "react-router-dom";
type IProps = RouteComponentProps & {
  path: string;
  backImgUrl: string;
  entryName:string;
};
class HomeItem extends React.Component<IProps>  {
    constructor(props:any){
        super(props);
    }
    private toPath(){
        this.props.history.push({pathname:this.props.path});
    }
    render(){
        return (
    
            <div className="HomeItem-Wrapper" onClick={this.toPath.bind(this)}>
              
              <div className="BackImg-box">
                {this.props.backImgUrl === "screening_room.jpg"?<img src={screening_room} style={{width:'200px',height:"256.46px"}} />:''}
                {this.props.backImgUrl === "configure.jpeg"?<img src={configure} style={{width:'200px',height:"256.46px"}} />:''}
                <span className="Span-box">{this.props.entryName}</span>
              </div>
              
            </div>
            
          
        );
    }
  
};

export default withRouter(HomeItem);
